﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;

namespace Pku.BookStore.IServices
{
    [ServiceContract(Name = "IUserServices", Namespace = "Pku.BookStore.IServices")]
    public interface IUserServices
    {
        /// <summary>
        /// 增加用户
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "Add")]
        int Add(Model.UserModel entity);

        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "Modify")]
        bool Modify(Model.UserModel entity);

        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "ModifyPass")]
        bool ModifyPass(Model.UserModel entity);

        /// <summary>
        /// 修改用户安全问题
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "ModifySafe")]
        bool ModifySafe(Model.UserModel entity);

        /// <summary>
        /// 修改用户最后登录IP和时间
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "ModifyLogin")]
        bool ModifyLogin(Model.UserModel entity);

        /// <summary>
        /// 搜索用户
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [OperationContract(Name = "Search")]
        List<Model.UserModel> Search(Model.UserParam param);

        /// <summary>
        /// 获取用户总数
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetCount")]
        int GetCount(Model.UserParam param);

        /// <summary>
        /// 返回用户信息
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetEntityById")]
        Model.UserModel GetEntityById(int userID);

        /// <summary>
        /// 是否存在
        /// </summary>
        /// <param name="Str">关键字</param>
        /// <param name="Type">0为用户名  1为邮箱</param>
        /// <returns></returns>
        [OperationContract(Name = "Exist")]
        bool Exist(string Str, int Type);

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract(Name = "Login")]
        Model.UserModel Login(Model.UserModel entity);

    }
}
